<template>
  <h1>Code: {{ code }}</h1>
  <br>
  <pre style="background:#000;color:white">r: {{ r }}</pre>
</template>

<script setup>
import {useRoute} from "vue-router";
import {ref} from "vue";

// 读取 url-path 的 code
const r = useRoute()
console.log(r)
const code = ref(r?.query?.code)
if (code !== undefined) {
  // 反之跳转到首页
} else {
// 如果没有获取到 code 则跳转 404
}

</script>

<style scoped></style>